import requests from "./request";

//登录
export const reqlogin = (data) => requests({ url: `/login`, method: 'POST', data })
// 获取用户信息
// getInfo
export const reqgetInfo = () => requests({ url: `/getInfo`, method: 'get' })

// 轮播图
export const reqbanner = () => requests({ url: `/system/banner/list`, method: 'get' })

// system/hot/orderby
export const reqhotlist = () => requests({
  url: `/system/hot/orderby`, method: 'get',
},)

// system/zone/list
export const reqzonelist = () => requests({ url: `/system/zone/list`, method: 'get' })

// system/news/list
export const reqnewslist = () => requests({ url: `/system/news/list`, method: 'get' })

// system/hot/list 分页查
// export const reqhotlists = ({zoneId,pageNum,hotName = ''}) => requests({ url: `/system/hot/list?zoneId=${zoneId}&pageNum=${pageNum}&hotName=${hotName}`, method: 'get'})
export const reqhotlists = ({ zoneId, pageNum, hotName }) => {
  let url = `/system/hot/list?zoneId=${zoneId}&pageNum=${pageNum}`;
  if (hotName) {
    url += `&hotName=${hotName}`;
  }
  return requests({ url, method: 'get' });
};

// 单查
export const reqhotlistsnull = () => requests({ url: `/system/hot/random`, method: 'get' })

// system/zone/{id}
export const reqzoneIdList = (id) => requests({ url: `/system/zone/${id}`, method: 'get' })

// 用户信息
// /system/user/getInfo
export const requserinfo = (userId) => requests({ url: `/system/user/getInfo/${userId}`, method: 'get' })

// 我的评论
// system/remark/select/{userId}
export const reqselect = (userId) => requests({ url: `/system/remark/select/${userId}`, method: 'get' })

//  我的收藏
// system/userHot/col/{userId} 
export const requserHotcol = (userId) => requests({ url: `/system/userHot/col/${userId}`, method: 'get' })

// 我的点赞
// system/userHot/like/{userId}
export const requserHotlike = (userId) => requests({ url: `/system/userHot/like/${userId}`, method: 'get' })

// 删除评论
// system/remark/{ids}
export const reqremark = (ids) => requests({ url: `/system/remark/${ids}`, method: 'post' })

// 删除点赞  没有

// 删除收藏
// system/userHot/{ids}
export const requserHot = (ids) => requests({ url: `/system/userHot/${ids}`, method: 'post' })

// 修改用户信息
export const editUserInfor = (data) => requests({ url: `/system/user/edit`, method: 'POST', data })

// 热点详情
export const hotDetail = (ids) => requests({ url: `/system/hot/${ids}`, method: 'GET' })

// 收藏点赞状态
export const usercolandlike = (data) => requests({ url: `/system/userHot/usercolandlike`, method: 'POST', data })

// 点赞
export const like = (data) => requests({ url: `/system/userHot/like`, method: 'POST', data })

// 收藏
export const col = (data) => requests({ url: `/system/userHot/col`, method: 'POST', data })

// 热点评论
export const selecthot = (data) => requests({ url: `/system/remark/selecthot`, method: 'POST', data ,})
// headers:{'Content-Type':'application/x-www-form-urlencoded'}


// /system/remark/add
export const remarkadd = (data) => requests({ url: `/system/remark/add`, method: 'POST', data ,})

// 注册
// /system/user/add
export const useradd = (data) => requests({ url: `/system/user/add`, method: 'POST', data ,})

// 忘记密码
// /system/user/callback
export const usercallback = (data) => requests({ url: `/system/user/callback`, method: 'POST', data ,})

// 反馈
// system/feedback/add
export const feedbackadd = (data) => requests({ url: `/system/feedback/add`, method: 'POST', data ,})


// 新闻列表
// system/news/{id}
export const reqnews = (id) => requests({ url: `/system/news/${id}`, method: 'get', })
